<@cms.content id=id>
    <#assign
        a=object
        parentId=a.parentId!''
        categoryId=a.categoryId!''
        modelId=a.modelId!''
        safe=true
        attribute=getContentAttribute(a.id)
    />
    <#if a.contribute && a.status != 1><#assign safe=false/></#if>
</@cms.content>
<@cms.category id=categoryId!><#assign category=object/></@cms.category>
<@cms.model id=modelId!><#assign model=object/></@cms.model>
<#macro bread category>
    <#if category.parentId?has_content>
        <@cms.category id=category.parentId>
            <@bread object/>
            <a href="${object.url!}" target="_blank">${object.name}</a> &gt;
        </@cms.category>
    </#if>
</#macro>
<style>
#content img,#content video{max-width:100%;}
</style>
<div class="pageFormContent" layoutH>
    <#if model?has_content>
        <#assign fieldList=model.fieldList![]/>
        <@cms.content id=parentId>
            <dl class="nowrap">
                <dt><@t.page 'content.parent'/>:</dt>
                <dd>
                    ${(object.title)!}
                </dd>
            </dl>
        </@cms.content>
            <dl>
                <dt><@t.page 'category'/>:</dt>
                <dd class="exclude-translate">
                    <@bread category/> <a href="${(category.url)!}" target="_blank">${(category.name)!}</a>
                </dd>
            </dl>
            <dl>
                <dt><@t.page 'model'/>:</dt>
                <dd class="exclude-translate">
                    ${(model.name)!}
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['title'])!}:</dt>
                <dd>
                    ${(a.copied?then('['+t.pageMessage('copied')+']',''))!}<span class="exclude-translate">${(a.title)!}</span>
                </dd>
            </dl>
            <dl>
                <dt><@t.page 'status'/>:</dt>
                <dd>
                    <@t.page 'status.content.'+(a.status)!/>
                </dd>
            </dl>
            <dl>
                <dt><@t.page 'content.score'/>:</dt>
                <dd>${a.score!}</dd>
            </dl>
        <#if 1=a.status>
            <dl>
                <dt><@t.page 'inspector'/>:</dt>
                <dd class="exclude-translate">
                     <@sys.user id=a.checkUserId>${(object.nickname)!}</@sys.user>
                </dd>
            </dl>
        </#if>
            <dl class="nowrap">
                <dt><#if model.onlyUrl>${(model.fieldTextMap['url'])!}<#else><@t.page 'url'/></#if>:</dt>
                <dd class="exclude-translate">
                    <a href="${(a.url)!}" target="_blank">${(a.url)!}</a>
                </dd>
            </dl>
        <#if a?has_content&&a.copied>
            <dl>
                <dt>${(model.fieldTextMap['source'])!}:</dt>
                <dd class="exclude-translate">${(attribute.source)!}</dd>
            </dl>
            <dl>
                <dt>${(model.fieldTextMap['sourceUrl'])!}:</dt>
                <dd class="exclude-translate">
                    <a href="${(attribute.sourceUrl)!}" target="_blank">${(attribute.sourceUrl)!}</a>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('author')>
            <dl>
                <dt>${(model.fieldTextMap['author'])!}:</dt>
                <dd class="exclude-translate">${(a.author)!}</dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('editor')>
            <dl>
                <dt>${(model.fieldTextMap['editor'])!}:</dt>
                <dd class="exclude-translate">${(a.editor)!}</dd>
            </dl>
        </#if>
        <#if category?has_content && (a.tagIds)?has_content>
<#if category.tagTypeIds?has_content>
    <@cms.tagType ids=category.tagTypeIds>
        <#list map as k,tagType>
            <dl class="nowrap">
                <dt>${tagType.name}:</dt>
                <dd class="exclude-translate">
                    <@cms.tag ids=a.tagIds>
                        <#list map as j,tag>
                            <#if tag.typeId?string=k>
                                ${tag.name},
                            </#if>
                        </#list>
                    </@cms.tag>
                </dd>
            </dl>
        </#list>
    </@cms.tagType>
<#else>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['tag'])!}:</dt>
                <dd class="exclude-translate">
                    <@cms.tag ids=a.tagIds>
                        <#list map as j,tag>
                            ${tag.name}<#sep>,
                        </#list>
                    </@cms.tag>
                </dd>
            </dl>
</#if>
        </#if>
            <dl>
                <dt><@t.page 'publish_date'/>:</dt>
                <dd>
                    ${(a.publishDate)!}<#if a.expiryDate?has_content> - ${(a.expiryDate)!}</#if>
                </dd>
            </dl>
        <#include "../include_page/extendData.html"/>
        <#if category?has_content&&category.extendId?has_content>
            <@sys.extendFieldList extendId=category.extendId>
                <@extendData name='categoryExtendDataList' extendList=list extendValues=attribute type='view' htmlSafe=safe/>
            </@sys.extendFieldList>
        </#if>
        <#if model?has_content>
            <@extendData name='modelExtendDataList' extendList=model.extendList extendValues=attribute type='view' htmlSafe=safe/>
        </#if>
        <#if a?has_content&&(a.hasImages||a.hasFiles)>
            <#if a.hasImages>
            <dl class="nowrap">
                <dt><@t.page 'image_list'/>:</dt>
                <dd>
            <@cms.contentFileList contentId=a.id fileTypes='image'>
                <#list page.list as file>
                    <div class="thumbnail">
                        <img src="${(file.filePath)!}"/>
                    </div>
                </#list>
            </@cms.contentFileList>
                </dd>
            </dl>
            </#if>
            <#if a.hasFiles>
                <dl class="nowrap">
                    <dt><@t.page 'attach_list'/>:</dt>
                    <dd>
                <@cms.contentFileList contentId=a.id fileTypes='video,audio,document,other'>
                    <#list page.list as file>
                        <a href="${(file.filePath)!}" target="_blank">${(file.description)!}</a>
                    </#list>
                </@cms.contentFileList>
                    </dd>
                </dl>
            </#if>
        </#if>
        <#if a.hasProducts>
            <dl class="nowrap">
                <dt><@t.page 'product_list'/>:</dt>
                <dd>
            <@cms.contentProductList contentId=a.id>
                <#list page.list as product>
                    <div class="unit">
                        <#if product.cover?has_content>
                            <p class="thumbnail">
                                <img src="${(product.cover)!}"/>
                            </p>
                        </#if>
                        <p><label><@t.page 'title'/>:</label>${product.title}</p>
                        <p><label><@t.page 'product.price'/>:</label>${product.price}</p>
                        <p><label><@t.page 'product.inventory'/>:</label>${product.inventory}</p>
                        <p><label><@t.page 'product.sales'/>:</label>${product.sales}</p>
                    </div>
                    <div class="divider"></div>
                </#list>
            </@cms.contentProductList>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('cover')&&a.cover?has_content>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['cover'])!}:</dt>
                <dd>
                    <div class="thumbnail">
                        <img src="${(a.cover)!}"/>
                    </div>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('description')>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['description'])!}:</dt>
                <dd class="exclude-translate">
                    <#list (a.description!'')?split('\n') as line>${line}<#sep><br/></#list>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('content')>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['content'])!}(${(attribute.wordCount)!}):</dt>
                <dd id="content" class="exclude-translate">
                    <#if safe>${(attribute.text?no_esc)!}<#else>${(attribute.text)!}</#if>
                </dd>
            </dl>
        </#if>
    </#if>
    <#if a?has_content>
        <@cms.contentRelatedList contentId=a.id>
            <#if page.totalCount gt 0>
            <dl class="nowrap">
                <dt><@t.page 'recommend_info'/>:</dt>
                <dd class="exclude-translate">
                    <#list page.list as a>
                        <a href="cmsContent/view.html?id=${a.relatedContentId}" class="exclude-translate" target="dialog" rel="viewContent${a.relatedContentId}">${(a.title)!}</a>
                    </#list>
                </dd>
            </dl>
            </#if>
        </@cms.contentRelatedList>
        <@sys.authorized roleIds=admin.roles urls='cmsComment/list,cmsComment/edit'><#assign authorizedMap=map/></@sys.authorized>
        <@cms.commentList advanced=true contentId=a.id pageSize=0>
            <dl class="nowrap">
                <dt>
                    <#if authorizedMap['cmsComment/edit']>
                        <a href="cmsComment/edit.html?contentId=${a.id}"  target="dialog" mask="true"><@t.page 'comment'/></a>
                    <#else>
                        <@t.page 'comment'/>
                    </#if>
                    :
                </dt>
                <dd class="exclude-translate">
                    <#if authorizedMap['cmsComment/list']>
                        <a href="cmsComment/list.html?contentId=${a.id}" target="navTab" rel="cmsComment/list" icon="<i class='icon-comment icon-large'></i>" title="<@t.page 'comment.management'/>">${page.totalCount!}</a>
                    <#else>
                        ${page.totalCount!}
                    </#if>
                </dd>
            </dl>
        </@cms.commentList>
    </#if>
</div>
<div class="formBar">
    <ul>
        <#if model?has_content&&model.hasChild>
            <li><a href="cmsContent/list.html?parentId=${a.id}&categoryId=${a.categoryId!}" class="button" target="navTab" rel="cmsContent/list" icon="<i class='icon-book icon-large'></i>"><@t.page 'content.child_management'/></a></li>
        </#if>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>